package com.example.demo.controller;

import com.example.demo.enity.Student;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

@CrossOrigin
@RestController
public class TestController {
    @GetMapping("/getStudents")
    public List<Student> getStudents(){
        return Student.getStudents();
    }

    @PostMapping("/addStudent")
    public String test02(@RequestBody Student student){
        System.out.println(student);
        return "插入成功";
    }

    @GetMapping("/student")
    public Student getStudent(){
        Student stu=new Student(6,"赤牙",98.0,new Date());
        return stu;
    }
}
